package com.hjxy.controller;

import com.hjxy.pojo.UserLogin;
import com.hjxy.service.ClassService;
import com.hjxy.service.UserLoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

/**
 * @description:
 * @author: ty
 * @createDate: 2020/10/8
 * @version: 1.0
 */
@Controller
public class ClientLoginController {

    @Autowired
    private UserLoginService userLoginService;


    @RequestMapping("/client/getView")
    public String getView(){
        return "client/index";
    }

//    @RequestMapping("/client/login")
//    public Map<String,Object> clintLogin(String username,String password){
//        if (username !=null && password != null){
//            System.out.println(password+"======");
//           // return userService.login(username, password);
//        }
//        Map<String, Object> result = new HashMap<>();
//        return result;
//    }

    @RequestMapping("/client/login")
 //   @ResponseBody
    public String clientLogin(String username, String password,UserLogin userLogin){
//        userLoginService.queryUsernamePassword(userLogin.getUsername(), userLogin.getPassword());
//        System.out.println(userLogin.getUsername()+"======="+ userLogin.getPassword());
//        Map<String,Object> result = new HashMap<>();
//        if (userLogin.getUsername().equals(username) && userLogin.getPassword().equals(password)){
//            result.put("code",0);
//            result.put("message","成功");
//            result.put("user",userLogin);
//            System.out.println(result);
//            return result;
//        }else {
//            result.put("code",-1);
//            result.put("message","成功");
//            return result;
//        }
        return "/student/index-student";
    }

    @RequestMapping("/client/stu")
    public String clientStudent(){
        return "/student/student-list";
    }

}
